package com.zsc.wxm.ysh.anjo.member.feign;

import com.zsc.wxm.ysh.anjo.member.feign.fallback.OssServiceImpl;
import com.zsc.wxm.ysh.anjo.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 描述：
 *
 * @author playmaker
 * @since 2021/2/12 16:46
 */
@FeignClient(value = "anjo-oss-service",fallback = OssServiceImpl.class)
public interface OssService {

    /**
     * 文件上传--头像
     * @param file
     * @return
     */
    @PostMapping(value = "/oss/file/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public Result upload(@RequestPart("file") MultipartFile file);

    /**
     * 文件删除
     * @param url
     * @return
     */
    @DeleteMapping("/oss/file/remove")
    Result remove(@RequestParam("url") String url);
}
